Skip to content

Conversation

@jaclync
Copy link
Contributor

@jaclync jaclync commented Jun 26, 2025

Closes WOOMOB-575

Just one reviewer is required.

Description

  • Add checkVisibility() method to POSEntryPointEligibilityCheckerProtocol now that the tab visibility is different from POS eligibility for i2
  • Implement different visibility logic based on pointOfSaleAsATabi2 feature flag:
    • When i2 enabled: only check country/currency and remote feature flag
    • When i2 disabled: use existing checkEligibility() logic
  • Add test coverage for the new visibility method

Steps to reproduce

Prerequisite: a WPCOM account with at least two stores where one store is eligible for POS, and the other in a country that is not eligible for POS (e.g. CA)

  • Log in to the store eligible for POS in the prerequisite --> the POS tab should be shown shortly
  • Tap on the POS tab --> POS should be launched as before
  • In wp-admin of this store, update the currency in WC settings to an eligible value
  • Relaunch the app --> the POS tab should still be shown even after a while
  • Tap on the POS tab --> POS should be launched as before. in a future task, a loading & eligible UI will be shown
  • Go to the Menu tab and switch to the store in a country ineligible for POS --> the POS tab should not be shown even after a while
  • Relaunch the app --> the POS tab should not be shown even after a while

Testing information

  • @jaclync verifies behavior with both i2 feature flag states

Example screenshots

For a store in an eligible country but ineligible for other reason (e.g. currency):

i2 feature flag enabled i2 feature flag disabled
Simulator Screenshot - iPad (A16) - 2025-06-26 at 16 35 56 Simulator Screenshot - iPad (A16) - 2025-06-26 at 16 36 48

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@jaclync jaclync added this to the 22.8 milestone Jun 26, 2025
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jun 26, 2025

App Icon📲 You can test the changes from this Pull Request in WooCommerce iOS Prototype by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS Prototype
Build Number30881
VersionPR #15824
Bundle IDcom.automattic.alpha.woocommerce
Commit1e2dcac
Installation URL64mdngbbcbg10
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@jaclync jaclync changed the title [Woo POS] Separate POS tab visibility logic with i2 feature flag [POS as a tab i2] Enable POS tab for stores in eligible countries behind i2 feature flag Jun 26, 2025
Copy link
Contributor

@staskus staskus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Works well 👍

break
case let .ineligible(reason):
if reason == .unsupportedCurrency {
break
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I understand, it's intentional to show POS option with unsupported currency for i2?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, as in the delivery plan pdfdoF-7po-p2, we're enabling the POS tab for all stores in eligible countries (US and UK for now).

(country: Country.gb, currency: CurrencyCode.USD, isPointOfSaleAsATabi2Enabled: true),
(country: Country.gb, currency: CurrencyCode.USD, isPointOfSaleAsATabi2Enabled: false)
])
fileprivate func is_ineligible_when_currency_is_not_supported(country: Country, currency: CurrencyCode, isPointOfSaleAsATabi2Enabled: Bool) async throws {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see much difference between is_ineligible_when_currency_is_not_supported and is_ineligible_when_country_is_not_supported tests. They both end up verifying the same condition .ineligible(reason: .unsupportedCountry))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the eligibility check (not the visibility check), the ineligible reason is different in these two test cases. is_ineligible_when_currency_is_not_supported takes in eligible countries but mismatching currency code and results in .ineligible(reason: .unsupportedCurrency), while is_ineligible_when_country_is_not_supported takes in ineligible countries and results in .ineligible(reason: .unsupportedCountry). Please let me know if I misunderstood anything.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for explaining, sorry, it's my mistake. For some reason, I read that both .ineligible results in unsupportedCountry, but that's not the case.

# Conflicts:
#	Modules/Sources/Experiments/DefaultFeatureFlagService.swift
#	Modules/Sources/Experiments/FeatureFlag.swift
@jaclync jaclync enabled auto-merge June 30, 2025 15:27
@jaclync
Copy link
Contributor Author

jaclync commented Jun 30, 2025

Enabling auto-merge now, if anything actionable comes up I will address them separately.

@jaclync jaclync merged commit 932ece2 into trunk Jun 30, 2025
13 checks passed
@jaclync jaclync deleted the feat/WOOMOB-575-separate-pos-tab-visibility branch June 30, 2025 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants